﻿using Ewell.BizComponent.Charge.UI.VM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ewell.BizComponent.Charge.UI.VM
{
    /// <summary>
    /// 收费信息
    /// </summary>
    public class ChargingInfoVm : NotifyPropertyChanged
    {
        /// <summary>
        /// 结算单标识
        /// </summary>
        private long _settlementId;
        public long settlementId
        {
            get => _settlementId; set
            {
                if (_settlementId != value)
                {
                    _settlementId = value;
                    OnPropertyChanged(nameof(settlementId));
                }
            }
        }
        /// <summary>
        /// 结算单类型代码
        /// </summary>
        private string _settlementTypeCode;
        public string settlementTypeCode { get => _settlementTypeCode; set
            {
                if(_settlementTypeCode != value)
                {
                    _settlementTypeCode = value;
                    OnPropertyChanged(nameof(settlementTypeCode));
                }
            } }
        /// <summary>
        /// 就诊标识
        /// </summary>
        private long _encounterId;
        public long encounterId
        {
            get => _encounterId; set
            {
                if (_encounterId != value)
                {
                    _encounterId = value;
                    OnPropertyChanged(nameof(encounterId));
                }
            }
        }
        /// <summary>
        /// 总金额
        /// </summary>
        private decimal? _amount;
        public decimal? amount
        {
            get => _amount; set
            {
                if (_amount != value)
                {
                    _amount = value;
                    OnPropertyChanged(nameof(amount));
                }
            }
        }
        /// <summary>
        /// 优惠金额
        /// </summary>
        private decimal? _discountAmount;
        public decimal? discountAmount
        {
            get => _discountAmount; set
            {
                if (_discountAmount != value)
                {
                    _discountAmount = value;
                    OnPropertyChanged(nameof(discountAmount));
                }
            }
        }
        /// <summary>
        /// 医保支付金额
        /// </summary>
        private decimal? _insurAmount;
        public decimal? insurAmount { get { return _insurAmount; } set
            {
                if( _insurAmount != value)
                {
                    _insurAmount = value;
                    OnPropertyChanged(nameof(insurAmount));
                }
            } }

        /// <summary>
        /// 应收金额
        /// </summary>
        public decimal? recAmount
        {
            get
            {
                return amount - discountAmount-(insurAmount ?? 0);
            }
        }
    }
}
